

#pragma once

#include "zdbmain.h"
#include "zacgi.h"

#pragma pack (push, 8)

const ZTCHAR kszVSFlat[]                 = UCRX_T("Flat");
const ZTCHAR kszVSFlatWithEdges[]        = UCRX_T("FlatWithEdges");
const ZTCHAR kszVSGouraud[]              = UCRX_T("Gouraud");
const ZTCHAR kszVSGouraudWithEdges[]     = UCRX_T("GouraudWithEdges");

const ZTCHAR kszVS2DWireframe[]   = UCRX_T("2dWireframe");
const ZTCHAR kszVS3DWireframe[]   = UCRX_T("Wireframe");
const ZTCHAR kszVSBasic[]         = UCRX_T("Basic");
const ZTCHAR kszVSHidden[]        = UCRX_T("Hidden");
const ZTCHAR kszVSRealistic[]     = UCRX_T("Realistic");
const ZTCHAR kszVSConceptual[]    = UCRX_T("Conceptual");
const ZTCHAR kszVSCustom[]        = UCRX_T("Custom");

const ZTCHAR kszVSShadesOfGray[]   = UCRX_T("Shades of Gray");
const ZTCHAR kszVSSketchy[]        = UCRX_T("Sketchy");
const ZTCHAR kszVSXRay[]           = UCRX_T("X-Ray");

const ZTCHAR kszVSShadedWithEdges[]  = UCRX_T("Shaded with edges");
const ZTCHAR kszVSShaded[]           = UCRX_T("Shaded");

const ZTCHAR kszVSDim[]           = UCRX_T("Dim");
const ZTCHAR kszVSBrighten[]      = UCRX_T("Brighten");
const ZTCHAR kszVSThicken[]       = UCRX_T("Thicken");
const ZTCHAR kszVSTransparent[]   = UCRX_T("Transparent");
const ZTCHAR kszVSLinePattern[]   = UCRX_T("Linepattern");
const ZTCHAR kszVSFacePattern[]   = UCRX_T("Facepattern");
const ZTCHAR kszVSColorChange[]   = UCRX_T("ColorChange");
const ZTCHAR kszVSJitterOff[]     = UCRX_T("JitterOff");
const ZTCHAR kszVSOverhangOff[]   = UCRX_T("OverhangOff");
const ZTCHAR kszVSEdgeColorOff[]  = UCRX_T("EdgeColorOff");

class UcDbVisualStyle : public UcDbObject
{
public:
    UCDB_DECLARE_MEMBERS(UcDbVisualStyle);

    UcDbVisualStyle();

    virtual ~UcDbVisualStyle();

    Ucad::ErrorStatus   setDescription (const ZTCHAR* pDescription);

    const ZTCHAR*        description    (void) const;

    Ucad::ErrorStatus setType(UcGiVisualStyle::Type type);

    UcGiVisualStyle::Type type() const;

#pragma warning (push)
#pragma warning (disable:4996)

    ZSOFT_DEPRECATED void setFaceStyle(const UcGiFaceStyle& faceStyle);

    ZSOFT_DEPRECATED const UcGiFaceStyle& faceStyle() const;

    ZSOFT_DEPRECATED void setEdgeStyle(const UcGiEdgeStyle& edgeStyle);

    ZSOFT_DEPRECATED const UcGiEdgeStyle& edgeStyle() const;

    ZSOFT_DEPRECATED Ucad::ErrorStatus setDisplayStyle(const UcGiDisplayStyle& displayStyle);

    ZSOFT_DEPRECATED const UcGiDisplayStyle& displayStyle() const;

#pragma warning (pop)

    Ucad::ErrorStatus setTrait(UcGiVisualStyleProperties::Property prop, 
                               const UcGiVariant *pVal,
                               UcGiVisualStyleOperations::Operation op 
                               = UcGiVisualStyleOperations::kSet);

    Ucad::ErrorStatus setTrait(UcGiVisualStyleProperties::Property prop, 
                               int nVal,
                               UcGiVisualStyleOperations::Operation op
                               = UcGiVisualStyleOperations::kSet);

    Ucad::ErrorStatus setTrait(UcGiVisualStyleProperties::Property prop, 
                               bool bVal,
                               UcGiVisualStyleOperations::Operation op
                               = UcGiVisualStyleOperations::kSet);

    Ucad::ErrorStatus setTrait(UcGiVisualStyleProperties::Property prop, 
                              double dVal,
                              UcGiVisualStyleOperations::Operation op
                              = UcGiVisualStyleOperations::kSet);

    Ucad::ErrorStatus setTrait(UcGiVisualStyleProperties::Property prop, 
                               double red,
                               double green,
                               double blue,
                               UcGiVisualStyleOperations::Operation op
                               = UcGiVisualStyleOperations::kSet);

    Ucad::ErrorStatus setTrait(UcGiVisualStyleProperties::Property prop, 
                               const UcCmColor *pColor,
                               UcGiVisualStyleOperations::Operation op
                               = UcGiVisualStyleOperations::kSet);

    const UcGiVariant& trait(UcGiVisualStyleProperties::Property prop, 
                             UcGiVisualStyleOperations::Operation *pOp = NULL) const;

    Ucad::ErrorStatus setTraitFlag(UcGiVisualStyleProperties::Property flagProp,
                                   ZSoft::UInt32 flagVal,
                                   bool bEnable = true);

    bool traitFlag(UcGiVisualStyleProperties::Property flagProp,
                   ZSoft::UInt32 flagVal) const;

    virtual Ucad::ErrorStatus dwgInFields  (UcDbDwgFiler* pFiler);

    virtual Ucad::ErrorStatus dwgOutFields (UcDbDwgFiler* pFiler) const;

    virtual Ucad::ErrorStatus dxfInFields  (UcDbDxfFiler* pFiler);

    virtual Ucad::ErrorStatus dxfOutFields (UcDbDxfFiler* pFiler) const;

    virtual UcGiDrawable*     drawable     (void);

    virtual void              setGsNode    (UcGsNode* pNode);

    virtual UcGsNode*         gsNode       (void) const;
    virtual ZSoft::UInt32     setAttributes (UcGiDrawableTraits* pTraits);
    virtual bool              isInternalUseOnly() const;

    virtual void              setInternalUseOnly(bool bInternalUseOnly);

    virtual Ucad::ErrorStatus copyTo(UcGiVisualStyle * pDest) const;

    virtual Ucad::ErrorStatus copyFrom(const UcGiVisualStyle * pSrc);

    virtual Ucad::ErrorStatus decomposeForSave(
                                  UcDb::UcDbDwgVersion ver,
                                  UcDbObject*&         replaceObj,
                                  UcDbObjectId&        replaceId,
                                  ZSoft::Boolean&      exchangeXData);

};

#pragma pack (pop)

